package com.dfrz.ch09;

/**
 * 作者：wangmaokang
 * 日期: 2021/4/19 10:50
 * 描述:
 */
public class Computer {
    private String brand;//品牌
    public String color;//颜色
    protected String cpu;
     String memory;
    public String harddick;
    public double price;
    public int work;

    @Override
    public String toString() {
        return "Computer{" +
                "brand='" + brand + '\'' +
                ", color='" + color + '\'' +
                ", cpu='" + cpu + '\'' +
                ", memory='" + memory + '\'' +
                ", harddick='" + harddick + '\'' +
                ", price=" + price +
                ", work=" + work +
                '}';
    }

    public void  open(){
        work=1;
        System.out.println("电脑打开");
    }

    public void close(){
        work=-1;
        System.out.println("电脑关闭");
    }

    public void sleep(){
        work=0;
        System.out.println("电脑休眠");
    }
}
